package ltd.smallwang;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

/**
 * @author justd
 * @date 2024-10-01 20:32
 */
class Leetcode0045Test {

  private final Leetcode0045 leetcode0045 = new Leetcode0045();

  @Test
  void jump01() {
    assertEquals(2, leetcode0045.jump(new int[]{2, 3, 1, 1, 4}));
  }

  @Test
  void jump02() {
    assertEquals(2, leetcode0045.jump(new int[]{2, 3, 0, 1, 4}));
  }

  @Test
  void jump03() {
    assertEquals(0, leetcode0045.jump(new int[]{2}));
  }

  @Test
  void jump04() {
    assertEquals(4, leetcode0045.jump(new int[]{1, 1, 1, 1, 1}));
  }

  @Test
  void jump05() {
    assertEquals(2, leetcode0045.jump(new int[]{7, 0, 9, 6, 9, 6, 1, 7, 9, 0, 1, 2, 9, 0, 3}));
  }

  @Test
  void jump06() {
    assertEquals(4, leetcode0045.jump(
        new int[]{6, 2, 6, 1, 7, 9, 3, 5, 3, 7, 2, 8, 9, 4, 7, 7, 2, 2, 8, 4, 6, 6, 1, 3}));
  }
}